// 调用部分系统管理页面的接口
/* 
    前端：老黑,
    后端：大白，
    开发开始时间：2022年8月22日
*/
// 引入我们需要的环境地址 

// 引入axios的对象
import requests from '@/utils/oaRequest'

// 调用列表 dict/list
export const messagesysMessageTemplate = (data) => requests({

        url: `http://localhost:8080/jeecg-boot/sys/message/sysMessageTemplate/list?&_t=1665123534&column=createTime&order=desc&field=id,,,&templateCode=${data.templateCode}&templateName=${data.templateName}&templateContent=${data.templateContent}&templateType=${data.templateType}&action&pageNo=${data.pageNo}&pageSize=${data.pageSize}`, //请求的地址
        method: "GET",

    })
    //新增接口
export const messagesysMessageTemplateadd = (data) => requests({
        url: `http://localhost:8080/jeecg-boot/sys/message/sysMessageTemplate/add`, //请求的地址
        method: "POST",
        data
    })
    // http://localhost:8080/jeecg-boot/sys/message/sysMessageTemplate/add

export const duplicatecheck = (data) => requests({
        url: `http://localhost:8080/jeecg-boot/sys/duplicate/check?_t=1665385542&tableName=sys_sms_template&fieldName=template_code&fieldVal=${data.name}`,
        method: "GET",
    })
    //编辑接口
export const edit = (data) => requests({
        url: `http://localhost:8080/jeecg-boot/sys/message/sysMessageTemplate/edit`,
        method: "PUT",
        data

    })
    //删除接口
export const deleteTemplate = (data) => requests({
        url: `http://localhost:8080/jeecg-boot/sys/message/sysMessageTemplate/delete?id=${data.id}`,
        method: "delete",
        data
    })
    //导出接口
export const exportTemplate = (data) => requests({
        url: `http://localhost:8080/jeecg-boot/sys/message/sysMessageTemplate/exportXls?_t=1665284464&column=createTime&order=desc&field=id,,,templateCode,templateName,templateContent,templateType,action&pageNo=${data.pageNo}&pageSize=${data.pageSize}`,
        method: "GET",
        data,
        responseType: 'blob'
    })
    //发送测试接口
export const sendMsg = (data) => requests({
        url: `http://localhost:8080/jeecg-boot/sys/message/sysMessageTemplate/sendMsg`,
        method: "POST",
        data,
    })
    //批量删除接口
export const deleteBatch = (data) => requests({
    url: `http://localhost:8080/jeecg-boot/sys/message/sysMessageTemplate/deleteBatch?ids=${data}`,
    method: "DElETE"
})

//index我的消息里调用列表接口
export const mineMessageTemplate = (data) => requests({
        url: `http://localhost:8080/jeecg-boot/sys/sysAnnouncementSend/getMyAnnouncementSend?titile=${data.titile}&pageNo=${data.pageNo}&pageSize=${data.pageSize}&sender=${data.sender}`,
        method: "GET",
        data,
    })
    //index里查看接口
export const getMyAnnouncementSend = (data) => requests({
    url: `http://localhost:8080/jeecg-boot/sys/sysAnnouncementSend/getMyAnnouncementSend?_t=1665993447&column=createTime&order=desc&field=id,,titile,msgCategory&sender&sendTime,priority,readFlag,action&pageNo=${data.pageNo}&pageSize=${data.pageSize}`,
    method: "GET",
    data

})